#pragma once
#include <map>
#include <vector>
#include <fstream>

class Data_Order
{
public:
	Data_Order();
	void ReadFile();
	void WriteFile();
private:
	int idNode, idMaterial, idSection, idElement, idBoundary, idLoad;
	std::map<int, std::string> m_Node;
	std::map<int, std::string> m_Material;
	std::map<int, std::string> m_Section;
	std::map<int, std::string> m_Element;
	std::map<int, std::string> m_Boundary;
	std::map<int, std::string> m_Load;

	void ReadNode(const char* FileName1);
	void ReadMaterial(const char* FileName1);
	void ReadSection(const char* FileName1);
	void ReadElement(const char* FileName1);
	void ReadBoundary(const char* FileName1);
	void ReadLoad(const char* FileName1);

	void WriteNode(std::ofstream& fout);
	void WriteMaterial(std::ofstream& fout);
	void WriteSection(std::ofstream& fout);
	void WriteElement(std::ofstream& fout);
	void WriteBoundary(std::ofstream& fout);
	void WriteLoad(std::ofstream& fout);

	void splitString(const std::string& str, std::vector<std::string>& tokens);
	void linescan(int id, int type, std::string& line, std::string& str);
};

